package core.todo.domain;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

/**
 * Todo entity.
 */

@PersistenceCapable(detachable="true")
public class Todo implements java.io.Serializable {

	// Fields
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;
	@Persistent
	private String title;
	@Persistent
	private String description;
	@Persistent
	private Date dueDt;
	@Persistent
	private Boolean complete;

	// Constructors

	/** default constructor */
	public Todo() {
	}

	/** minimal constructor */
	public Todo(String title, Boolean complete) {
		this.title = title;
		this.complete = complete;
	}

	/** full constructor */
	public Todo(Long id, String title, String description, Date dueDt, Boolean complete) {
		this.id = id;
		this.title = title;
		this.description = description;
		this.dueDt = dueDt;
		this.complete = complete;
	}
	
	public String toString() {
		return "TODO [id="+getId() +", title="+getTitle() + ",dueDt " + getDueDt() + ", complete=" + getComplete();
	}

	// Property accessors
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getDueDt() {
		return this.dueDt;
	}

	public void setDueDt(Date dueDt) {
		this.dueDt = dueDt;
	}

	public Boolean getComplete() {
		return this.complete;
	}

	public void setComplete(Boolean complete) {
		this.complete = complete;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

}